import * as types from './constants'
export const changeList = (data) => ({
    type: types.CHANGE_HOME_LIST,
    data
})

export const getHomeList = () => {
    return (dispatch,getState, axiosInstance) => {
        return axiosInstance.get('/api/news.json')
            .then((res) => {
                const list = res.data.data
                dispatch(changeList(list))
            })
    }
}